#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

const int N = 2010;
const db eps = 1e-10;

db p[N],u[N],f[N];
int ca[N],cb[N],n,a,b;

void check(db ac,db bc){
	for(int i = 1;i <= n;i++){
		f[i] = f[i-1]; ca[i] = ca[i-1]; cb[i] = cb[i-1];
		if(f[i] < f[i-1] + p[i] - ac - eps) f[i] = f[i-1] + p[i] - ac,ca[i] = ca[i-1] + 1,cb[i] = cb[i-1];
		if(f[i] < f[i-1] + u[i] - bc - eps) f[i] = f[i-1] + u[i] - bc,cb[i] = cb[i-1] + 1,ca[i] = ca[i-1];
		if(f[i] < f[i-1] + p[i] + u[i] - ac - bc - p[i] * u[i] - eps) f[i] = f[i-1] + p[i] + u[i] - ac - bc - p[i] * u[i],ca[i] = ca[i-1] + 1,cb[i] = cb[i-1] + 1;
	}
}

db getbc(db ac){
	db l = 0,r = 1;
	for(int i = 1;i <= 50;i++){
		db mid = (l + r) / 2.0;
		check(ac,mid);
		if(cb[n] > b) l = mid;
		else r = mid;
	}return l;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	scanf("%d %d %d",&n,&a,&b);
	for(int i = 1;i <= n;i++) scanf("%lf",&p[i]);
	for(int i = 1;i <= n;i++) scanf("%lf",&u[i]);
	db l = 0,r = 1,bb;
	for(int i = 1;i <= 50;i++){
		db mid = (l + r) / 2.0;
		bb = getbc(mid);
		if(ca[n] > a) l = mid;
		else r = mid;
	}
	check(l,bb); printf("%.6lf\n",f[n] + a * l + b * bb);
	return 0;
}

